// vite.config.ts
import { fileURLToPath, URL } from "node:url";
import { defineConfig, loadEnv } from "file:///D:/gitee/qa.ui/vue-qa/node_modules/.pnpm/vite@5.3.3_@types+node@20.14.10_sass@1.77.6/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/gitee/qa.ui/vue-qa/node_modules/.pnpm/@vitejs+plugin-vue@5.0.5_vite@5.3.3_@types+node@20.14.10_sass@1.77.6__vue@3.4.31_typescript@5.4.5_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { createSvgIconsPlugin } from "file:///D:/gitee/qa.ui/vue-qa/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.3.3_@types+node@20.14.10_sass@1.77.6_/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import path from "path";
import fs from "fs";
var __vite_injected_original_dirname = "D:\\gitee\\qa.ui\\vue-qa";
var __vite_injected_original_import_meta_url = "file:///D:/gitee/qa.ui/vue-qa/vite.config.ts";
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd(), "");
  let qaConfig = "1";
  const status = fs.statSync("public/config.qa");
  if (status.isFile()) {
    qaConfig = fs.readFileSync("public/config.qa", "utf-8");
  }
  console.log(qaConfig);
  let url = env.VITE_API_URL;
  switch (qaConfig) {
    case "1":
      url = env.VITE_API_URL;
      break;
    case "2":
      url = env.VITE_API_URL_TWO;
      break;
  }
  console.log(url);
  return {
    plugins: [
      vue(),
      createSvgIconsPlugin({
        iconDirs: [path.resolve(__vite_injected_original_dirname, "./src/assets/iconsvg")],
        symbolId: "icon-[name]"
      })
    ],
    root: process.cwd(),
    resolve: {
      alias: {
        "@": fileURLToPath(new URL("./src", __vite_injected_original_import_meta_url))
      }
    },
    server: {
      host: "0.0.0.0",
      port: env.VITE_PORT
    },
    // vite 配置
    define: {
      __APP_ENV__: JSON.stringify(env.APP_ENV),
      "process.env": env,
      //'process.url': url,
      "process.url": JSON.stringify(url)
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data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N0YXR1cyA9IGZzLnN0YXRTeW5jKFwicHVibGljL2NvbmZpZy5xYVwiKTtcclxuXHJcbiAgICBpZiAoc3RhdHVzLmlzRmlsZSgpKSB7XHJcbiAgICAgICAgcWFDb25maWcgPSBmcy5yZWFkRmlsZVN5bmMoXCJwdWJsaWMvY29uZmlnLnFhXCIsIFwidXRmLThcIilcclxuICAgIH1cclxuXHJcbiAgICBjb25zb2xlLmxvZyhxYUNvbmZpZyk7XHJcblxyXG4gICAgbGV0IHVybCA9IGVudi5WSVRFX0FQSV9VUkw7XHJcblxyXG4gICAgc3dpdGNoIChxYUNvbmZpZykge1xyXG4gICAgICAgIGNhc2UgXCIxXCI6XHJcbiAgICAgICAgICAgIHVybCA9IGVudi5WSVRFX0FQSV9VUkw7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgXCIyXCI6XHJcbiAgICAgICAgICAgIHVybCA9IGVudi5WSVRFX0FQSV9VUkxfVFdPO1xyXG5cclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICB9XHJcblxyXG4gICAgLy9jb25zb2xlLmxvZyhlbnYpXHJcbiAgICBjb25zb2xlLmxvZyh1cmwpXHJcblxyXG4gICAgcmV0dXJuIHtcclxuICAgICAgICBwbHVnaW5zOiBbXHJcbiAgICAgICAgICAgIHZ1ZSgpLFxyXG4gICAgICAgICAgICBjcmVhdGVTdmdJY29uc1BsdWdpbih7XHJcbiAgICAgICAgICAgICAgICBpY29uRGlyczogW3BhdGgucmVzb2x2ZShfX2Rpcm5hbWUsIFwiLi9zcmMvYXNzZXRzL2ljb25zdmdcIildLFxyXG4gICAgICAgICAgICAgICAgc3ltYm9sSWQ6IFwiaWNvbi1bbmFtZV1cIixcclxuICAgICAgICAgICAgfSksXHJcbiAgICAgICAgXSxcclxuICAgICAgICByb290OiBwcm9jZXNzLmN3ZCgpLFxyXG5cclxuICAgICAgICByZXNvbHZlOiB7XHJcbiAgICAgICAgICAgIGFsaWFzOiB7XHJc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